import fetch from '@/utils/fetch'

export function getAreaList(params) {
	return fetch({
	    url: '/uc/v1/mgt/area',
	    method: 'get',
	    params
  	})
}

export function getAreaDetail(id) {
	return fetch({
	    url: `/uc/v1/mgt/area/${id}`,
	    method: 'get'
  	})
}

export function getDistrictList() {
	return fetch({
		url: '/uc/v1/mgt/district',
		method: 'get'
	})
}

export function createArea(data) {
	return fetch({
		url: '/uc/v1/mgt/area',
		method: 'post',
		data
	})
}

export function modifyArea(id, data) {
	return fetch({
	    url: `/uc/v1/mgt/area/${id}`,
	    method: 'patch',
	    data
	})
}

export function getDataTree() {
	return fetch({
	    url: '/uc/v1/mgt/data_tree',
	    method: 'get'
	})
}

//获取设备运行状态列表
export function getEquipmentRunningStateList() {
	return fetch({
	    url: `/device/v1/mgt/device_room_status`,
	    method: 'get'
  	})
}

//拉取所有小区列表
export function getAreaTree() {
	return fetch({
	    url: '/uc/v1/mgt/area/tree',
	    method: 'get'
  	})
}

//根据等级拉取所有对应区域列表
export function getLevelArea(params) {
	return fetch({
	    url: '/uc/v1/mgt/district/level',
	    method: 'get',
	    params
  	})
}